package com.youngjun.user.api.admin;

import com.youngjun.common.mybatis.page.PageInfo;
import com.youngjun.common.mybatis.web.Response;
import com.youngjun.user.pojo.dto.ProfileDTO;
import com.youngjun.user.pojo.dto.query.OrganizationQueryDTO;
import com.youngjun.user.pojo.vo.ProfileVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Api(tags = "单位管理")
@FeignClient(
        name = "${ums.api.name:ums-service}",
        contextId = "organizationRestApi",
        url  = "${ums.api.url:http://127.0.0.1:8080}",
        path = "/organization"
)
public interface IOrganizationRestApi {

    @ApiOperation(value="查询单位信息")
    @RequestMapping(method = RequestMethod.POST, path = "/query_list")
    Response<PageInfo<ProfileVO>> queryList(@RequestBody OrganizationQueryDTO dto);

    @ApiOperation(value="创建单位信息")
    @RequestMapping(method = RequestMethod.POST, path = "/create")
    Response<ProfileVO> create(@RequestBody ProfileDTO dto);

    @ApiOperation(value="修改单位信息")
    @RequestMapping(method = RequestMethod.PUT, path = "/modify")
    Response<ProfileVO> modify(@RequestBody ProfileDTO dto);

}